﻿@using DTcms.Common;
@model DTcms.Model.sitemapconfig
@{
    List<SelectListItem> changefreq = new List<SelectListItem>(){
        new SelectListItem(){Text="经常", Value="always"},
        new SelectListItem(){Text="每小时", Value="hourly"},
        new SelectListItem(){Text="每天", Value="daily"},
        new SelectListItem(){Text="每周", Value="weekly"},
        new SelectListItem(){Text="每月", Value="monthly"},
        new SelectListItem(){Text="每年", Value="yearly"},
        new SelectListItem(){Text="从不", Value="never"}
    };
    List<SelectListItem> priority = new List<SelectListItem>(){
        new SelectListItem(){Text="0.1", Value="0.1"},
        new SelectListItem(){Text="0.2", Value="0.2"},
        new SelectListItem(){Text="0.3", Value="0.3"},
        new SelectListItem(){Text="0.4", Value="0.4"},
        new SelectListItem(){Text="0.5", Value="0.5"},
        new SelectListItem(){Text="0.6", Value="0.6"},
        new SelectListItem(){Text="0.7", Value="0.7"},
        new SelectListItem(){Text="0.8", Value="0.8"},
        new SelectListItem(){Text="0.9", Value="0.9"},
        new SelectListItem(){Text="1.0", Value="1.0"}
    };
}
<form id="form1" class="layui-form" url="sitemapBuild">
    @Html.AntiForgeryToken()
    <!--导航栏-->
    <div class="pageheader">
        <div class="page-bar">
            <ul class="page-breadcrumb">
                <li><a href="javascript:;"><i class="iconfont icon-home1"></i> 首页</a> </li>
                <li><a href="javascript:;">站点地图参数设置</a> </li>
            </ul>
        </div>
    </div>
    <!--/导航栏-->
    <!--内容-->
    <div class="layui-fluid">
        <div class="layui-tab layui-tab-card">
            <ul class="layui-tab-title" id="floatHead">
                <li class="layui-this">系统基本信息</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-form-item">
                    <label class="layui-form-label">自动生成</label>
                    <div class="layui-input-block">
                        @Html.RadioButton("sitemap_auto", 0, Model.sitemap_auto == 0, new { title = "关闭", id = "sitemap_auto_0" })
                        @Html.RadioButton("sitemap_auto", 1, Model.sitemap_auto == 1, new { title = "开启", id = "sitemap_auto_1" })
                        <span class="Validform_checktip">*更新内容时候自动更新网站地图</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">立即生成xml</label>
                    <div class="layui-input-block">
                        <select class="select" name="ddlSiteId" id="ddlSiteId" url="/webapi/siteJson" selectValue="" promtion="请选择站点" datatype="*" sucmsg=" "><option value="">请选择站点</option></select>
                        <span class="Validform_checktip">适合谷歌和百度，地图网址 http://@DTRequest.GetHost()/sitemap.xml</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">更新频率</label>
                    <div class="layui-input-block">
                        首页 @Html.DropDownList("sitemap_changefreq_index", new SelectList(changefreq, "Value", "Text", Model.sitemap_changefreq_index))&nbsp;&nbsp;
                        列表页 @Html.DropDownList("sitemap_changefreq_list", new SelectList(changefreq, "Value", "Text", Model.sitemap_changefreq_list))&nbsp;&nbsp;
                        内容页 @Html.DropDownList("sitemap_changefreq_show", new SelectList(changefreq, "Value", "Text", Model.sitemap_changefreq_show))
                        <i class="layui-icon layui-icon-tips" lay-tips="XML地图文件使用，你输入的网站的网页内容更新的频率。" lay-direction="2"></i>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">优先级别</label>
                    <div class="layui-input-block">
                        首页 @Html.DropDownList("sitemap_priority_index", new SelectList(priority, "Value", "Text", Model.sitemap_priority_index))&nbsp;&nbsp;
                        列表页 @Html.DropDownList("sitemap_priority_list", new SelectList(priority, "Value", "Text", Model.sitemap_priority_list))&nbsp;&nbsp;
                        内容页 @Html.DropDownList("sitemap_priority_show", new SelectList(priority, "Value", "Text", Model.sitemap_priority_show))
                        <i class="layui-icon layui-icon-tips" lay-tips="XML地图文件使用，所抓取页面在您网站的重要性，告诉搜索引擎抓取的优先级。数值越大，优先级越高。" lay-direction="2"></i>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">类型</label>
                    <div class="layui-input-block layui-rule-multi-checkbox">
                        @Html.CheckBox("is_xml", true, new { title = "XML" })
                        @Html.CheckBox("is_html", false, new { title = "HTML" })
                        @Html.CheckBox("is_txt", false, new { title = "TXT" })
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">实时推送Url的token</label>
                    <div class="layui-input-block">
                        @Html.TextBox("sitemap_zzbaidutoken", Model.sitemap_zzbaidutoken, new { @class = "input normal" })
                        <span class="Validform_checktip">这里填入 <a href="https://ziyuan.baidu.com" target="_blank" style="color: red;">百度搜索资源平台</a> 的准入密钥，才能第一时间推送文章链接给百度蜘蛛。</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--/内容-->
    <!--工具栏-->
    <div class="page-footer">
        <div class="btn-wrap">
            <button class="layui-btn icon-btn" id="btnSubmit"><i class="layui-icon layui-icon-ok"></i>提交保存</button>
        </div>
    </div>
    <!--/工具栏-->
</form>
@section Scripts{
    <script type="text/javascript">
        layui.use(['jqueryform', 'validform', 'cascadeSelect'], function () {
            var cascadeSelect = layui.cascadeSelect;
            cascadeSelect.init('ddlSiteId', false);
            $("#form1").initValidform('#btnSubmit', 1);
        });
    </script>
}